package jianzhiOffer;

public class num10_1 {
    public int fib(int n) {
        if(n == 0 || n == 1) {
            return n == 0? 0: 1;
        }
        int num1 = 0;
        int num2 = 1;
        for(int i = 1;i < n;i ++) {
            int temp = num2;
            num2 = (num1 + num2) % 1000000007;
            num1 = temp;
        }
        return num2;
    }
}
